<?php
    $arr=[
        ['1','龙哥','历险记','18'],
        ['2','杰哥','历险记','18'],
        ['3','郭美俄米','大记','99'],
        
    ];
    if(isset($_POST['sub'])){
        $name=$_POST['name'];
        $arr=array_filter($arr,function($v) use ($name){
            return $v[1]==$name;
        });
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="" method="post">
        <input type="text" name="name" id="" placeholder="请输入作者">
        <input type="submit" value="查询" name="sub">
    </form>
    <table style="border: 1px;">
        <th>id</th><th>姓名</th><th>经历</th><th>年龄</th>
        <?php
            forEach($arr as $v){

            
        ?>
        <tr>
            <td><?php echo $v[0]?></td>
            <td><?php echo $v[1]?></td>
            <td><?php echo $v[2]?></td>
            <td><?php echo $v[3]?></td>
        </tr>
        <?php } ?>
    </table>
</body>
</html>